<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let arr = [
        {
          入职日期: 43678,
          姓名: '高大山',
          工号: 20089,
          手机号: 13041131879,
          转正日期: 43678,
        },
        {
          入职日期: 43780,
          姓名: '章三',
          工号: 20090,
          手机号: 13041131880,
          转正日期: 43780,
        },
        {
          入职日期: 43600,
          姓名: '李四',
          工号: 20091,
          手机号: 13041131881,
          转正日期: 43600,
        },
        {
          入职日期: 43578,
          姓名: '王武',
          工号: 20092,
          手机号: 13041131882,
          转正日期: 43578,
        },
      ]
      let arr1 = [
        {
          timeOfEntry: 43678,
          username: '高大山',
          workNumber: 20089,
          mobile: 13041131879,
          correctionTime: 43678,
        },
        {
          timeOfEntry: 43780,
          username: '章三',
          workNumber: 20090,
          手机号: 13041131880,
          correctionTime: 43780,
        },
        {
          timeOfEntry: 43600,
          username: '李四',
          workNumber: 20091,
          手机号: 13041131881,
          correctionTime: 43600,
        },
        {
          timeOfEntry: 43578,
          username: '王武',
          workNumber: 20092,
          手机号: 13041131882,
          correctionTime: 43578,
        },
      ]

      let renderTab = function (arr) {
        let newArr = []
        for (let i = 0; i < arr.length; i++) {
          let obj = {}
          // for (let key in arr[i]) {
          obj.timeOfEntry = arr[i].入职日期
          obj.username = arr[i].姓名
          obj.workNumber = arr[i].工号
          obj.mobile = arr[i].手机号
          obj.correctionTime = arr[i].转正日期

          newArr.push(obj)
        }
        console.log(newArr)
      }
      renderTab(arr)

      // console.log(arr[i][key])
      // if (arr[i][key] === 'timeOfEntry') {
      //   obj['timeOfEntry'] = arr[i][key]
      // }
      // obj = {
      //   'timeOfEntry':arr[i][key],
      //   'username':arr[i][key],
      //   'workNumber':arr[i][key],
      //   'mobile':arr[i][key],
      //   'correctionTime':arr[i][key],
      // }
      // }
    </script>
  </body>
</html>
